/**
 * 
 */
package com.teamall.web.family.customdb.dao;

import java.util.List;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.teamall.core.common.Page;
import com.teamall.web.family.customdb.arg.CustomCodeFamilyInfoArg;
import com.teamall.web.family.customdb.dao.mapper.ICustomFamilyAndMemberMapper;
import com.teamall.web.family.db.po.FamilyInfoPO;
import com.teamall.web.family.db.po.FamilyMemberPO;
import com.teamall.web.fpgz.db.po.CodeFamilyInfoPO;

/**
 * <Description> <br>
 * 
 * @author pan.xiaobo<br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2017年8月23日 <br>
 * @since V1.0<br>
 * @see com.teamall.web.family.customdb.dao <br>
 */
@Repository
public class CustomFamilyAndMemberDao extends SqlSessionDaoSupport {
    @Resource(name = "majorSqlSessionTemplate")
    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        super.setSqlSessionTemplate(sqlSessionTemplate);
    }

    public int updateFamilyInfo(FamilyInfoPO record) {
        return getMapper().updateFamilyInfo(record);
    }

    public int updateFamilyMember(FamilyMemberPO record) {
        return getMapper().updateFamilyMember(record);
    }

    public ICustomFamilyAndMemberMapper getMapper() {
        return getSqlSession().getMapper(ICustomFamilyAndMemberMapper.class);
    }

    public Page<CodeFamilyInfoPO> selectCodeFamilyInfoPOByArgAndPage(
            CustomCodeFamilyInfoArg arg, Page<CodeFamilyInfoPO> resultPage) {
        List<CodeFamilyInfoPO> resultList = getMapper()
                .selectCodeFamilyInfoPOByArgAndPage(arg, resultPage);
        resultPage.setResultList(resultList);
        return resultPage;
    }
}
